'''
cookie : 识别客户
1、手动设置cookie 是有有效期，失效后，要改代码
2、 登陆后的每个接口，都要带着cookie信息
3、 代码不常用，临时使用，可以这样写，简单
'''

import requests
# 没有登陆时，返回的是登陆页面
url = "https://www.bagevent.com/account/dashboard"

r = requests.get(url)

print(r.text)

# cookie如果被其他人窃取，也是登陆后的状态
# 登陆后，返回用户统计信息
head = {"Cookie": '__auc=2a3b6d0d179c643ad61269abc48; MEIQIA_TRACK_ID=1tKsBAYnNlKrp47j7GYuzUEIgx1; _ga=GA1.2.1967667668.1622529009; 1tKsBAYnNlKrp47j7GYuzUEIgx1=undefined; _gid=GA1.2.2128736604.1624862664; __asc=ae45655417a567cf7491748eca6; Hm_lvt_1fc37bec18db735c69ebe77d923b3ab9=1622528994,1622613806,1624862658,1624948668; MEIQIA_VISIT_ID=1ubybaNZBMBYEp1eogEp9bHCLEU; BAGSESSIONID=61284c64-052e-4a9d-8885-d81cae68407c; JSESSIONID=5B3C9AA3AB2D5C8FF67871D18BBF8336; _gat=1; Hm_lpvt_1fc37bec18db735c69ebe77d923b3ab9=1624948683; BAG_EVENT_TOKEN_=02de735f68204d51009e7edda78e58c13a3fcdd1; BAG_EVENT_CK_KEY_="2780487875@qq.com"; BAG_EVENT_CK_TOKEN_=2440f5d17af838308ba4b390db81af38'}

r = requests.get(url,headers = head)
print(r.text)  # <title>BagEvent - Account Overview</title>

